﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using AiShou.BLL;
using AiShou.Common;
using AiShou.IBLL;

namespace AiShou.WebSite
{
    /// <summary>
    /// DiscussPublishHandler 的摘要说明
    /// </summary>
    public class DiscussPublishHandler : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            var videoId = context.Request.QueryString["id"];
            var discuss = new AiShou.Model. Discuss
            {
                Avatar= context.Request.Form["Avatar"],
                Content = context.Request.Form["Content"],
                NickName = context.Request.Form["NickName"],
                ReplayTo = context.Request.Form["ReplayTo"],
                AddTime = TimeHelper.GetTimeByUnix(long.Parse(context.Request.Form["AddTime"]))
            };

            IDiscussManager manager = new DiscussManager();
            manager.Add(videoId,discuss);
            context.Response.End();
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}